
import 'dart:convert';

BookReadDataMap bookReadDataMapFromJson(String str) =>
    BookReadDataMap.fromJson(json.decode(str));

//String bookReadDataMapToJson(BookReadDataMap data) => json.encode(data.toJson());

class BookReadDataMap {
  BookReadDataMap({
    this.dataMap,
  });

  Map<String, DataMap>? dataMap;

  factory BookReadDataMap.fromJson(Map<String, dynamic> json) =>
      BookReadDataMap(
        dataMap: json["dataMap"] != null
            ? Map.from(json["dataMap"]).map(
                (k, v) => MapEntry<String, DataMap>(k, DataMap.fromJson(v)))
            : null,
      );

  // Map<String, dynamic> toJson() => {
  //     "dataMap": dataMap!=null ? Map.from(dataMap).map((k, v) => MapEntry<String, dynamic>(k, v.toJson())): null,
  //};
}

class DataMap {
  DataMap({
    this.readTimes,
    this.readBooks,
    this.loginPeriod,
    this.quizTimes,
  });

  int? readTimes;
  int? readBooks;
  int? loginPeriod;
  int? quizTimes;

  factory DataMap.fromJson(Map<String, dynamic> json) => DataMap(
        readTimes: json["readTimes"],
        readBooks: json["readBooks"],
        loginPeriod: json["loginPeriod"],
        quizTimes: json["quizTimes"],
      );

  Map<String, dynamic> toJson() => {
        "readTimes": readTimes,
        "readBooks": readBooks,
        "loginPeriod": loginPeriod,
        "quizTimes": quizTimes,
      };
}
